(function () {
    console.log(echarts)
  let myCharts = echarts.init(document.querySelector(".pie"));
  let option = {
    tooltip: {
      trigger: "item",
      formatter: "{a}<br/>{b}:{c} ({d}%)",
    },
    series: [
      {
        name: "点位统计",
        type: "pie",
        radius: ["10%", "60%"],
        center: ["50%", "50%"],
        roseType: "radius",
        itemStyle: {
          borderRadius: 0,
        },
        data: [
          { value: 20, name: "上海" },
          { value: 18, name: "北京" },
          { value: 12, name: "南京" },
          { value: 10, name: "云南" },
          { value: 18, name: "广州" },
          { value: 16, name: "四川" },
          { value: 12, name: "河南" },
          { value: 18, name: "邯郸" },
        ],
        label: {
          fontSize: 10,
        },
        labelLine: {
          length: 6,
          length2: 8,
        },
      },
    ],
  };
  myCharts.setOption(option);
  window.addEventListener("resize", function () {
    myCharts.resize();
  });
})();
